﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AVCUMPlatform.DingTalkService.Model
{
   public class DingTalkSendMsg
    {
        /// <summary>
        /// 请求id
        /// </summary>
        public string request_id { get; set; }
        /// <summary>
        /// 返回内容
        /// </summary>
        public string errmsg { get; set; }
        /// <summary>
        /// 返回码
        /// </summary>
        public int errcode { get; set; }
        /// <summary>
        /// 异步发送id
        /// </summary>
        public long task_id { get; set; }
    }
    public class DingTalkAsyncSend
    {
        public Int64 agent_id { get; set; }
        public bool to_all_user { get; set; } = false;
        public string userid_list { get; set; }
        public MsgModel msg { get; set; }
    }

    public class DingTalkSend
    {
        public string touser { get; set; }
        public string toparty { get; set; }
        public Int64 agentid { get; set; }
        public string msgtype { get; set; }
        public Text text { get; set; }
    }

    public class MsgModel
    {
        public string msgtype { get; set; }
        public OAModel oa { get; set; }
        public ActionCardModel action_card { get; set; }
    }

    public class OAModel
    {
        public HeadModel head { get; set; }
        public BodyModel body { get; set; }
        public string message_url { get; set; }
    }
    public class ActionCardModel
    {
        public string title { get; set; }
        public string markdown { get; set; }
        public string single_title { get; set; }
        public string single_url { get; set; }
        //public string btn_orientation { get; set; }
        //public List<ActionCardButton> btn_json_list { get; set; }
    }
    public class ActionCardButton
    {
        public string title { get; set; }
        public string action_url { get; set; }
    }
    public class HeadModel
    {
        public string bgcolor { get; set; }
        public string text { get; set; }
    }
    public class BodyModel
    {
        public string title { get; set; }
        public string content { get; set; }
        public List<KeyValue> form { get; set; }
    }
    //public class FormModel
    //{
    //    /// <summary>
    //    /// 关键信息1
    //    /// </summary>
    //    public KeyValue keyword1 { get; set; }
    //    /// <summary>
    //    /// 关键信息2
    //    /// </summary>
    //    public KeyValue keyword2 { get; set; }
    //    /// <summary>
    //    /// 关键信息3
    //    /// </summary>
    //    public KeyValue keyword3 { get; set; }
    //    /// <summary>
    //    /// 关键信息4
    //    /// </summary>
    //    public KeyValue keyword4 { get; set; }
    //    /// <summary>
    //    /// 备注
    //    /// </summary>
    //    public KeyValue remark { get; set; }
    //}
    public class KeyValue
    {
        public string key { get; set; }
        public string value { get; set; }
    }

}
